<%-- 
    Document   : adminViewPendingComp
    Created on : Oct 18, 2013, 9:52:17 AM
    Author     : h10t93
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

        <script>
            $(function() {
                $( "#datepicker").datepicker();
            });
        </script> 
    </head>
    <body>
        <form name="frm" method="POST">
            <h1>Status Report of the pending complaints.!</h1>
            <p>Select by date: </p> 
            <p>Date: <input type="text" id="datepicker" name="txtdateP" /></p>
            <button type="submit" onclick="frm.action='ManageServlet?action=reportPendingCompByDate'">View</button>
            <button type="submit" onclick="frm.action='ManageServlet?action=pendingComp'">Load All</button>
            <c:set var="total" scope="session" value="${sessionScope['totalCompPending']}"/>
            <p>Total complaints pending : <c:out value="${total}"/></p>
        
            <table border="1">
                <tr>
                    <th>Complaint ID</th>
                    <th>User ID</th>
                    <th>User Name</th>
                    <th>User Department</th>
                    <th>Category</th>
                    <th>Technician Name</th>
                    <th>Date Lodging</th>               
                </tr>
                <c:forEach var="p" items="${sessionScope['ListPendingComp']}">
                    <tr>
                        <td>${p.idComp}</td>
                        <td>${p.idUser}</td>
                        <td>${p.nameUser}</td>
                        <td>${p.department}</td>
                        <td>${p.compCategory}</td>
                        <td>${p.nameTechnician}</td>
                        <td>${p.dateLodging}</td>
                    </tr>
                </c:forEach>
            </table>
        </form>
    </body>
</html>
